// JavaScript Document
//up load file img
function PreviewImage(no) {
	var oFReader = new FileReader();
	oFReader.readAsDataURL(document.getElementById("uphinh"+no).files[0]);

	oFReader.onload = function (oFREvent) {
		document.getElementById("uploadPreview"+no).src = oFREvent.target.result;
	};
};
//section ln
$(document).ready(function() {
	$(".c_list_row").click(function(){
		$(".c_ocbuuvang").removeClass("active");
		$(this).find($(".c_ocbuuvang")).addClass("active");
	});
});


//menu infor
$(document).ready(function(){			
	var allPanels = $("#accordion ul").hide();
	$("#accordion h3").click(function(){ 
		$this = $(this);
		$target =  $this.parent().find('ul');
	
		if(!$this.hasClass('active')){
			$("#accordion h3").removeClass('active');
			allPanels.slideUp('fast');
			$this.addClass('active');
			$target.slideDown('fast');
		}
	});
});
//datepicker
$(document).ready(function() {
	$('#datetimepicker5').datetimepicker({pickTime: false});
});
//pobup form
$(document).ready(function() {
	$('#c_login').magnificPopup({
		type: 'inline',
		preloader: false,
		focus: '#name',
		callbacks: {
			beforeOpen: function() {
				if($(window).width() < 700) {
					this.st.focus = false;
				} else {
					this.st.focus = '#name';
				}
			}
		}
	});
});

$(document).ready(function() {
	$('#c_signup').magnificPopup({
		type: 'inline',
		preloader: false,
		focus: '#name',

		
		callbacks: {
			beforeOpen: function() {
				if($(window).width() < 700) {
					this.st.focus = false;
				} else {
					this.st.focus = '#name';
				}
			}
		}
	});
});

$(document).ready(function() {
	$('#c_forget').magnificPopup({
		type: 'inline',
		preloader: false,
		focus: '#name',

		
		callbacks: {
			beforeOpen: function() {
				if($(window).width() < 700) {
					this.st.focus = false;
				} else {
					this.st.focus = '#name';
				}
			}
		}
	});
});

$(document).ready(function() {
	$('#c_forget1').magnificPopup({
		type: 'inline',
		preloader: false,
		focus: '#name',

		
		callbacks: {
			beforeOpen: function() {
				if($(window).width() < 700) {
					this.st.focus = false;
				} else {
					this.st.focus = '#name';
				}
			}
		}
	});
});
$(document).ready(function() {
	$('#c_forget2').magnificPopup({
		type: 'inline',
		preloader: false,
		focus: '#name',

		
		callbacks: {
			beforeOpen: function() {
				if($(window).width() < 700) {
					this.st.focus = false;
				} else {
					this.st.focus = '#name';
				}
			}
		}
	});
});
$(document).ready(function() {
	$('#c_login_index').magnificPopup({
		type: 'inline',
		preloader: false,
		focus: '#name',

		
		callbacks: {
			beforeOpen: function() {
				if($(window).width() < 700) {
					this.st.focus = false;
				} else {
					this.st.focus = '#name';
				}
			}
		}
	});
});
//dasbore viewmore
$(document).ready(function(){
	$("#c_viewmore").click(function(){ 
		$(".c_group_comment").addClass('active');
		$(".c_dd_right_opacity").addClass('hide');
	});
});
//mk viewmore
$(document).ready(function(){
	$("#c_viewmore_mk").click(function(){ 
		$(".t-overflow").addClass('active');
	});
});
//mk viewmore
$(document).ready(function(){
	$("#c_viewmore_categories").click(function(){ 
		$(".c_group_check_box").addClass('active');
		$("#c_viewmore_categories").hide();
	});
});

//doi dau
$(document).ready(function(){
	
});
//olw
$(document).ready(function() {
 
	$("#owl").owlCarousel({
	items : 2,
	itemsDesktop : [1199,2],
	itemsDesktopSmall : [979,2]
	 
	});
 
});
//table
$(function(){
        $("table").stupidtable();
    });
//close tag
$(document).ready(function(){
	$(".c_csn_close").click(function(){
		
		$(this).parent(this).addClass('hide');
	});
});



